<template>
    <div class="Box">
        <div class="left">
            <span class="total" :style="'color:' + props.color ">{{ props.total }}</span>
            <span class="label">
                <slot name='title'></slot>
            </span>
        </div>
        <div class="right">
            <div :style="{ 'background-color': props.iconBack }">
                <component :is="props.icon" class="icon"></component>
            </div>
        </div>
    </div> 
</template>

<script lang="ts" setup>
import { defineProps } from 'vue'

interface Props{
    total: number
    iconBack: string
    icon: string
    color?:string
}
const props = defineProps<Props>()
</script>

<style lang="scss" scoped>
.Box{
    width: 100%;
    background: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 8px;
    padding: 20px 30px;
    box-sizing: border-box;
    box-shadow: var(--el-box-shadow);
    user-select: none;
}
.left{
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 5px;
}
.total{
    font-size: 20px;
    font-weight: 600;
}
.label{
    color: #61666D;
    font-size: 13px;
}
.right{
    @include flexRowCenter;
    & div:nth-child(1){
        position: relative;
        width: 50px;
        height: 50px;
        border-radius: 50%;
        background: coral;
        @include flexRowCenter;
        overflow: hidden;
    }
    & div:nth-child(1)::after{
        content: '';
        position: absolute;
        background: rgb(255, 255, 255,0.2);
        width: 10px;
        height: 100px;
        rotate: 45deg;
        left: 20px;
        top: -10px;
        z-index: 99;
    }
    & div:nth-child(1)::before{
        content: '';
        position: absolute;
        background: rgb(255, 255, 255,0.2);
        width: 10px;
        height: 100px;
        rotate: 45deg;
        left: 0px;
        top: -15px;
        z-index: 99;
    }
}
.icon{
    width: 30px;
    height: 30px;
    color: white;
}
</style>